<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    protected $fillable = ['user_id','post_id','content'];//可以注入的字段
    //关联用户
    public function user(){
    	return $this->belongsTo('App\User');
    }
    //评论所属文章
    public function post(){
    	return $this->belongsTo('App\Post');
    }
}
